#include <stdio.h>
#include <string.h>
#include<assert.h>
#define STLEN 1000
int main()
{
	int ad;
	int shuzi = 0, zimu = 0, kongge = 0, fuhao = 0, arrlength = 0;
	char word[STLEN];
	fgets(word, STLEN, stdin);
	arrlength = strlen(word);
	for (int i = 0; i < arrlength; i++)
	{
		if ((word[i] >= '0') && (word[i] <= '9'))
		{
			shuzi++;
		}
		else if ((word[i] >= 'A' && word[i] < 'Z') || (word[i] >= 'a' && word[i] < 'z'))
		{
			zimu++;
		}
		else if (word[i] == ' ')
		{
			kongge++;
		}
		else
		{
			fuhao++;
		}
	}
	fuhao--;
	printf("%d\n%d\n%d\n%d\n", zimu, kongge, shuzi, fuhao);
	return 0;
}
